www.gusucode.com > 基于VBLAST-OFDM的MATLAB SIMULATION,图形化界面,并且给出了各仿真图 > 基于VBLAST-OFDM的MATLAB SIMULATION,图形化界面,并且给出了各仿真图/vblast-ofdm simulation/Vblast.m

    
function [raw_bits]=vblast(d,channel_est,count,SimulationParameters)

global SimulationConstants;
N=SimulationParameters.N;
M=SimulationParameters.M;
H=reshape(channel_est(count,1:N*M),N,M);
H_save=H;
r=d;
%initialization
G=pinv(H);
[gk k0]=min(sum(abs(G).^2,2));
      
for m=1:M     % This FOR loop determines the ordering sequence k1 and determines the 'a' matrix. This is just one run,i.e. one for each H matrix.
         			  %The 'a' matrix is automatically sorted as [a1 a2...aM]
         
    k1(m)=k0;
    w(m,:)=G(k1(m),:);
    y=w(m,:)*r;
    a(k1(m),1)=Q(y,SimulationParameters.ModulationType);
    r = r - a(k1(m)) * H_save(:, k1(m));   
    H(:,k0)=zeros(N,1);
    G=pinv(H);
    for t=1:m
       G(k1(t),:)=inf;
    end
    [gk k0]=min(sum(abs(G).^2,2));
end
soft_bits = rx_demodulate_vblast(conj(a(:))',SimulationParameters.ModulationType);

deint_bits=soft_bits;
% hard decision of soft bits, used to measure uncoded BER
raw_bits = deint_bits > 0;